#ifndef APP_FLASH_H_
#define APP_FLASH_H_
#include "Mini58Series.h"
#define USER_DATA_PAGE  0
#define FLASH_CHECK_FLAGE 0xA55AA55A

typedef struct {
  uint8_t dev_sweep_speed;
  uint8_t dev_x_step;
  uint8_t dev_y_step;
  uint8_t dev_Y_step_Time;
  uint32_t dev_flash_check_flage;  
} USER_FLASH_ST;

void app_flash_init(void);

void app_flash_SID_get_fromUID(uint8_t *sid);
void app_flash_erase(uint8_t page);
//小端模式,1 page = 512
void app_flash_write_buf(uint8_t page, uint8_t *p, const uint16_t len) ;
//小端模式
void app_flash_read_buf(uint8_t page, uint8_t *p, const uint16_t len) ;
void app_user_flash_init(void);
USER_FLASH_ST* app_user_flash_get(void);
void app_user_flash_save(void);

uint32_t CRC32_get(const uint8_t *buf, uint32_t size);
#endif

